package com.workhours.dto;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * 登录请求DTO
 *
 * @author WorkHours
 * @since 2025-09-19
 */
public class LoginRequest {
    
    @NotBlank(message = "登录口令不能为空")
    @Size(max = 20, message = "登录口令不能超过20位")
    @Pattern(regexp = "^[a-zA-Z0-9]+$", message = "登录口令只能包含数字和字母")
    private String token;
    
    // 构造函数
    public LoginRequest() {}
    
    public LoginRequest(String token) {
        this.token = token;
    }
    
    // Getters and Setters
    public String getToken() {
        return token;
    }
    
    public void setToken(String token) {
        this.token = token;
    }
    
    @Override
    public String toString() {
        return "LoginRequest{" +
                "token='" + token + '\'' +
                '}';
    }
}
